package com.yan.demo;

public class MethodTest6 {
    public static void main(String[] args) {
        encipher(1983);
    }

    public static void encipher(int num){
        int i = 0;
        int[] arr = new int[10];
        while(num > 0){
            arr[i] = num % 10;
            num = num / 10;
            i++;
        }
        for (int j = 0; j < i; j++) {
            arr[j] = (arr[j] + 5) % 10;
        }
        System.out.print("加密后的结果是:");
        for (int j = 0; j < i; j++) {
            System.out.print(arr[j]);
        }

    }
}
